package com.graduation.sfstore;

import com.graduation.sfstore.entity.TemperatureData;
import com.graduation.sfstore.service.TemperatureService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringRunner;

@RunWith(SpringRunner.class)
@SpringBootTest
@ContextConfiguration(classes = SfstoreApplication.class)
public class Temtext {

    @Autowired
    private TemperatureService temperatureService;

    @Test
    public void TemTest1(){
        TemperatureData temperatureData = new TemperatureData();
        temperatureData.setTemperature("26");
        temperatureData.setHumidity("49");
        temperatureData.setMaterial("S264900");
        int i = temperatureService.insertTemperature(temperatureData);
        if (i>0){
            System.out.println("温湿度更新成功");
        }
    }
}
